package assignmentImplementation;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

import keyValueBaseInterfaces.ValueList;

@SuppressWarnings("serial")
@XmlRootElement(name="valuelistimpl")
@XmlAccessorType
public class ValueListImpl implements ValueList<ValueImpl>{
	
	@XmlElement(name="valueList")
	private List<ValueImpl> vList;
	

	public ValueListImpl()
	{
		this.vList = new ArrayList<ValueImpl>();
	}

	public void add(ValueImpl v) {
		this.vList.add(v);
	}

	public void remove(ValueImpl v) {
		this.vList.remove(v);
	}

	public void merge(ValueList<ValueImpl> v) {

		this.vList.addAll(v.toList());
	}

	public List<ValueImpl> toList() {

		return this.vList;
	}
	
	public Iterator<ValueImpl> iterator() {
		Iterator<ValueImpl> i = this.vList.iterator();
		return i;
	}

}
